

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'student.label', default: 'Student')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    
    </head>
    <body>
        <div class="body">
            <h1><g:message code="student.noclasses.create.message"/></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${studentInstance}">
            <div class="errors">
                <g:renderErrors bean="${studentInstance}" as="list" />
            </div>
            </g:hasErrors>
     
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="newStudentList" controller="studentMgr"><g:message code="default.return.label"/><g:message code="student.noclasses.list.message"/></g:link></span>
        </div>
            <g:form action="save" method="post" name="studentCreate" controller="studentMgr">
                <div class="dialog">
                    <table>
                        <tbody> 
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name">最近录入的新生</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'name', 'errors')}">
                                    <%
                                    def studentList = Student.findAllBySchoolAndClasses(session.school,null,[max:10, sort:"id", order:"desc"]).each{
                                    %>
                                    ${it.name}&nbsp;&nbsp;
                                    <%}%>
                                </td>
                            </tr>
 
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="name"><g:message code="student.name.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: studentInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" maxlength="50" value="${studentInstance?.name}" />
                                    
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
       <g:javascript src="domain/studentmgr_create.js" type="text/javascript"/>
 
    </body>
</html>
